<html>
<head>
<title>Creating and Using Packages</title>
</head>
<body>
<table width=100%>
<tr>
<td align=left>
<a href="index.html"><img src=../../images/PreviousArrow.gif width=26 height=26 align=bottom border=0 alt="Previous | "></a><a
href="creating.html"><img src=../../images/NextArrow.gif width=26 height=26 align=bottom border=0 alt="Next | "></a><a
href="../../index.html"><img src=../../images/WayUpArrow.gif width=26 height=26 align=bottom border=0 alt="Trail Map | "></a><a
href="../index.html"><img src=../../images/toolHeader.gif width=26 height=26 align=bottom border=0 alt="The Java Development Environment | "></a>
<td>
<td align=right>
<a href="TOC.html"><strong><em>Table of Contents</em></strong></a>
</td>
</tr>
</table>
<p>
<hr size=4>

<h1>
     Creating and Using Packages
</h1>
<p>
<blockquote>

The Java development environment includes several packages
of reusable classes. These packages are discussed at length
in the previous lesson 
<a href=../packages/index.html><em>Package Tour</em></a>
<a href=../packages/index.html><img src=../../images/toolIcon.gif width=20 height=20 border=0></a>.
The Java language provides a way for you to create packages
of classes and interfaces as well.

<h4><a href=creating.html>Roll Your Own Packages</a>
</h4>
<blockquote>
Packages are groups of related classes and interfaces
and provide convenient a mechanism for managing a large
set of classes and interfaces and avoiding naming conflicts.
<p>
Using the <code>package</code> statement you can create a package
and indicate that certain classes are part of that package.
</blockquote>

<h4><a href=import.html>Using Objects and Classes from Other Packages</a>
</h4>
<blockquote>
To use objects that are contained in package, whether it's a package
provided with the development environment, or one you've created, you
need to import the package.
</blockquote>

<h4><a href=prepend.html>Clarifying Object and Class Names</a>
</h4>
<blockquote>
When two classes in two different packages have the same name, you
have to prepend the package name to the class name.
</blockquote>

<h4><a href=dirs.html>Directory Structure</a>
</h4>
<blockquote>
The interpreter expects the directory structure of classes to be the same
as the package hierarchy.
</blockquote>

</blockquote>
<p>
<hr size=4>
<p>
<table width=100%>
<tr>
<td align=left>
<a href="index.html"><img src=../../images/PreviousArrow.gif width=26 height=26 align=top border=0 alt="Previous | "></a><a
href="creating.html"><img src=../../images/NextArrow.gif width=26 height=26 align=top border=0 alt="Next | "></a><a
href="../../index.html"><img src=../../images/WayUpArrow.gif width=26 height=26 align=top border=0 alt="Trail Map | "></a><a
href="../index.html"><img src=../../images/toolHeader.gif width=26 height=26 align=top border=0 alt="The Java Development Environment | "></a>
<td>
<td align=right>
<a href="TOC.html"><strong><em>Table of Contents</em></strong></a>
</td>
</tr>
</table>
</body>
</html>
